<%@ taglib prefix="a" uri="http://java.sun.com/jmaki" %>
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<jsp:useBean id="event" scope="session" class="com.asaga.tools.Event_DBImpl" />
<jsp:useBean id="client" scope="session" class="com.asaga.tools.SystemClient_DBImpl" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<% 
String username = (String)session.getAttribute("username");
if(username==null){
    response.sendRedirect("login.jsp?message=Please log in again.");
}
%>

<html>
    <head>
    <title>Autism Society of America - Greater Georgia Chapter User Portal</title>
    <style title="text/css">@import "style.css"; </style>
    <link rel="stylesheet" href="css/gray.css" type="text/css" title="gray">
    <link rel="stylesheet" href="css/autism.css" type="text/css" />
    <link rel="alternate stylesheet" type="text/css" href="css/red.css" title="red">
    <link rel="alternate stylesheet" type="text/css" href="css/blue.css" title="blue">
    <link rel="alternate stylesheet" type="text/css" href="css/orange.css" title="orange">
    <script type="text/javascript" src="javascript/styleswitcher.js"></script>
</head>
<body>
<div class="main">
    <%@ include file="header.html" %>
    <div id="content">
        <h2>WELCOME, <%=username%>!(<a href="AutismSiteMasterController?action=logoff">Logout</a>)
            <div id="colorchange">
                <ul>
                    <li><a href="#" onclick="setActiveStyleSheet('gray'); return false;" title="Gray Theme"><img src="images/btngray.gif" alt="Gray Theme" /></a></li>
                    <li><a href="#" onclick="setActiveStyleSheet('red'); return false;" title="Red Theme"><img src="images/btnred.gif" alt="Red Theme" /></a></li>
                    <li><a href="#" onclick="setActiveStyleSheet('blue'); return false;" title="Blue Theme"><img src="images/btnblue.gif" alt="Blue Theme" /></a></li>
                    <li><a href="#" onclick="setActiveStyleSheet('orange'); return false;" title="Orange Theme"><img src="images/btnorange.gif" alt="Orange Theme" /></a></li>
                </ul>
            </div>
        </h2>
        <p id="warning"><jsp:getProperty name="event" property="warningMessage" />
        </p>
        <!-- Main page content -->
        <div class="myEvents">
            <h4 class="heading">My Events </h3>
            <ul>
                <% int size = event.eventListSize();
                if(size != 0){
                    for(int i = 0; i < size; i++){%>
                <li class="eventListing"><span class="title">
                        <%event.setTempEvent(i);%>
                        <%= event.tempEvent.title %>
                    </span><br />
                    Date:
                    <%=event.tempEvent.startDate.toString()%> thru
                    <%=event.tempEvent.endDate.toString()%>
                    <br />
                    Time: <%=event.tempEvent.startTime%> - <%=event.tempEvent.endTime%>
                </li>
                <%}%> 
                <% 
                }%>
            </ul>
            <span class="eventDisplay"><a href="AutismSiteMasterController?action=addEventForm">Add an Event</a></span>
            <span class="eventDisplay"><a href="AutismSiteMasterController?action=listEvents">List My Events</a></span>
        </div>          
        
    </div>
</div>
<%@ include file="footer.html" %>       
</body>
</html>
